<template>
    <div class="box" ref="boxRef" @click="changeColor"></div>
</template>
<script lang='ts' setup>
  import {ref} from 'vue'
  const boxRef=ref<HTMLElement|null>(null)
  const changeColor=()=>{
    if(boxRef.value){
      boxRef.value.style.backgroundColor="red"
    }
  
    
     
  }
</script>
<style lang='scss' scoped>
.box{
    width: 100px;
    height: 100px;
    border: 1px solid #000;
    border-radius: 50%;
}
</style>